package com.demo.math.templateimpl;

import com.demo.math.app.QuestionBankContext;
import com.demo.math.templateabstract.QuestionBankTemplate;

import java.util.ArrayList;
import java.util.List;

public class QuestionBankFill2Template extends QuestionBankTemplate {
    private final static int range = 10;

    //最多72题
    private static final List<String> strategyList = new ArrayList<>();

    {
        for (int i = 0; i < 54; i++) {
            strategyList.add(QuestionBankContext.FILL_PLUS_MIN_2);
        }

    }

    public QuestionBankFill2Template(int page) {
        super(page);
    }

    @Override
    public String title() {
        return "口算测试（填空）";
    }

    @Override
    public List<String> body() {
        List<String> body = new ArrayList<>();
        StringBuilder sb = null;
        for (int i = 0; i < strategyList.size(); i++) {
            if (i % 3 == 0) {
                if (i != 0) {
                    body.add(sb.toString());
                }
                sb = new StringBuilder();
            }
            String math = questionBankContext.math(strategyList.get(i), range);
            sb.append(math);
            sb.append(zanwei(20-math.length()));

        }
        body.add(sb.toString());

        return body;
    }


}
